g13cbf

g13cbf © Numerical Algorithms Group, 2002.

Purpose

G13CBF Univariate time series, smoothed sample spectrum using spectral smoothing by the trapezium frequency (Daniell) window

Synopsis

[xg,ng,stats,ifail] = g13cbf(nx,l,xg<,px,mw,lg,mtx,pw,ifail>)

Description

 
 The supplied time series may be mean or trend corrected (by 
 least-squares), and tapered, the tapering factors being those of 
 the split cosine bell:
 
       (     (         1 ))   
       (     ( (pi)(t- -)))   
      1(     (         2 ))   
      -(1-cos( ----------)),   1<=t<=T
      2(     (     T     ))   
 
       (     (           1 )) 
       (     ( (pi)(n-t+ -))) 
      1(     (           2 )) 
      -(1-cos( ------------)), n+1-T<=t<=n
      2(     (      T      )) 
 
     1,                        otherwise
 
         [ np]                       
 where T=[ --] and p is the tapering proportion.
         [ 2 ]                       
 
 The unsmoothed sample spectrum
 
                               | n                  |2
              *           1    | --                 |
             f ((omega))= -(pi)| >  x exp(i(omega)t)| 
                          2    | --  t              |
                               | t=1                |
 
 is then calculated for frequency values
 
                          2(pi)k
                (omega) = ------ , k=0,1,...,[K/2]
                       k    K   
 
 where [ ] denotes the integer part.
 
 The smoothed spectrum is returned at a subset of these 
 frequencies for which k is a multiple of a chosen value r, i.e.,
 
                              2(pi)l
             (omega)  =(nu) = ------,  l=0,1,...,[L/2]
                    rl     l    L   
 
 where K=r*L. The user will normally fix L first, then choose r so
 that K is sufficiently large to provide an adequate 
 representation for the unsmoothed spectrum, i.e., K>=2*n. It is 
 possible to take L=K, i.e., r=1.
 
 The smoothing is defined by a trapezium window whose shape is 
 supplied by the function
 
     W((alpha))=1,             |(alpha)| <=p
 
                 1-|(alpha)|
     W((alpha))= -----------,  p<|(alpha)|<=1
                   1-p  
 
 the proportion p being supplied by the user.
 
 The width of the window is fixed as 2(pi)/M by the user supplying
 M. A set of averaging weights are constructed:
 
                    ( (omega) M)                
                    (        k )                 (pi)
              W =g*W( ---------) , 0<=(omega) <= ----
               k    (   (pi)   )             k    M
 
 where g is a normalising constant, and the smoothed spectrum 
 obtained is
 
          ^         --                 *               
          f((nu) )= >               W f ((nu) +(omega) ).
                l   --               k       l        k
                                (pi)                   
                    |(omega) |< ----                   
                            k    M                     
 
 If no smoothing is required M should be set to n, in which case 
                         ^         *                            
 the values returned are f((nu) )=f ((nu) ). Otherwise, in order 
                               l         l                      
 that the smoothing approximates well to an integration, it is 
 essential that K>>M, and preferable, but not essential, that K be
 a multiple of M. A choice of L>M would normally be required to 
 supply an adequate description of the smoothed spectrum. Typical 
 choices of L~=n and K~=4n should be adequate for usual smoothing 
 situations when M<n/5.
 
                              ^                                  
 The sampling distribution of f((omega)) is approximately that of 
               2                                                
 a scaled (chi)  variate, whose degrees of freedom d is provided 
               d                                                
 by the routine, together with multiplying limits mu, ml from 
 which approximate 95% confidence intervals for the true spectrum 
                                      ^              ^           
 f((omega)) may be constructed as [ml*f((omega)), mu*f((omega))]. 
                    ^                                        
 Alternatively, log f((omega)) may be returned, with additive 
 limits.
 
 The bandwidth b of the corresponding smoothing window in the 
 frequency domain is also provided. Spectrum estimates separated 
 by (angular) frequencies much greater than b may be assumed to be
 independent.
 

Parameters

g13cbf

Required Input Arguments:

nx                                    integer
l                                     integer
xg (:)                                real

Optional Input Arguments:                       <Default>

px                                    real     0.0
mw                                    integer  nx
lg                                    integer  0
mtx                                   integer  0
pw                                    real     0
ifail                                 integer  -1

Output Arguments:

xg (:)                                real
ng                                    integer
stats (4)                             real
ifail                                 integer